export class Tab {
  title = 'untiled';
  path = '';                           // file path
  code = '';                           // code
  id?: string;
  historyCode = '';                   // Copy of the last code text
  language?: string;                          // code language
  isValueChange = false;            // Whether the code has been modified
  saveTimer?: any;
  closeable = true;
  readonly?: boolean;
  [key: string]: any
}

export class FurtherData {
  id: string;                    // the projectVersion id
  projectId: string;             // the project id
  title: string;                 // the projectVersion title
  number: number;                // the projectVersion version
  thumbnail?: '';                 // url of the projectVersion image
  canEdit: boolean;              // can you update these codes
  account: Account;               // user account (can be null if there is no valid token)
  code: CodeData[];               // list of code files in the project
  spaces: SpaceData[];
}

export interface Account {
  username: string;            // user's further username
  id: string;                  // user's further user id
  email?: string;               // user's further email address
  createdAt?: string;           // created ISO date eg "2019-04-10T09:07:05.894Z"
  updatedAt?: string;           // updated ISO date eg "2019-04-11T09:07:05.894Z"
}

export interface CodeData {
  id: string;                // the code id
  path: string;              // the code path and name eg 'src/led.py'
  content?: string;          // the actual code eg 'print("hello")\n'
  projectVersionId: string;  // the projectVersion id (again)
  createdAt?: string;         // created ISO date eg "2019-04-10T09:07:05.894Z"
  updatedAt?: string;         // updated ISO date eg "2019-04-11T09:07:05.894Z"
}

export interface SpaceData {
  id: string;                // the space id (the bit you need, used as the school code)
  name?: string;              // the space name
  thumbnail?: string;         // url of the space image
  isAdmin?: boolean;             // is user an admin of the space
  isMember?: boolean;            // is user a member of the space
  createdAt?: string;        // created ISO date eg "2019-04-10T09:07:05.894Z"
  updatedAt?: string;         // updated ISO date eg "2019-04-11T09:07:05.894Z"
}

export interface ResponseConfig {
  data: any;
  info: string;
  success: boolean;
  code: string;
}

export interface ResponseError{
  statusCode: number;
  name: string;
  message: string;
  code: number | string;
}
